package com.six.shop.controller.api;

import com.six.core.entity.CheckShop;
import com.six.core.entity.Shop;
import com.six.core.vo.Result;
import com.six.shop.service.CheckShopService;
import com.six.shop.service.ShopService;
import com.six.shop.vo.SearchCheckShop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName:ApiCheckShopController
 * Description:
 * date:2023/2/27 16:16
 *
 * @since JDK 1.8
 */
@Api(value = "shop/api/checkshop", tags = {"ClassName:ApiCheckShopController Description: date:2023/2/27 16:16"})
@RestController
@RequestMapping("shop/api/checkshop")

public class ApiCheckShopController {
    @Autowired
    private CheckShopService checkShopService;


    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "SearchCheckShop", name = "checkShop", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "currentPage", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageSize", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "POST")
    @PostMapping("findAll")
    public Result findAll(@RequestBody SearchCheckShop checkShop, @RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "5")Integer pageSize){
        return checkShopService.findAll(checkShop,currentPage,pageSize);
    }
    @PostMapping("updateState")
    public Result updateState(@RequestBody CheckShop checkShop){
        return checkShopService.updateState(checkShop);
    }
    @PostMapping("insertCheckShop")
    public Result insertCheckShop(@RequestBody CheckShop checkShop){
        return checkShopService.insertCheckShop(checkShop);
    }
    @PostMapping("findMyCheck")
    public Result findMyChec(){
        return checkShopService.findMyCheck();
    }

}
